import request from '@/utils/request'

/**
 * 分群列表
 * http://192.168.88.247:4999/web/#/80/2987
 * @param {*} params
 * @returns
 */
export function listUserGroup (params) {
  return request({
    url: '/usergroup/admin/v1/list',
    method: 'get',
    params
  })
}

/**
 * 获取属性字段
 * http://192.168.88.247:4999/web/#/80/3029
 * @param {*} params
 * @returns
 */
export function listProperties (params) {
  return request({
    url: '/usergroup/admin/v1/properties',
    method: 'get',
    params
  })
}

/**
 * 获取用户属性条件类型
 * http://192.168.88.247:4999/web/#/80/2983
 * @param {*} params
 * @returns
 */
export function listPropertieType (params) {
  return request({
    url: '/usergroup/admin/v1/data_types',
    method: 'get',
    params
  })
}

/**
 * 创建用户分群
 * http://192.168.88.247:4999/web/#/80/2986
 * @param {*} data
 * @returns
 */
export function addUserGroup (data) {
  return request({
    url: '/usergroup/admin/v1/add',
    method: 'post',
    data
  })
}

/**
 * 更新用户分群
 * http://192.168.88.247:4999/web/#/80/2988
 * @param {*} data
 * @returns
 */
export function updateUserGroup (data) {
  return request({
    url: '/usergroup/admin/v1/update',
    method: 'put',
    data
  })
}

/**
 * 更新分群状态
 * http://192.168.88.247:4999/web/#/80/2989
 * @param {*} data
 * @returns
 */
export function updateStatusUserGroup (data) {
  return request({
    url: '/usergroup/admin/v1/update_status',
    method: 'put',
    data
  })
}
